Name:		Real Pic fr Benutzerprofil 1.1 Final
Datum:		17-08-2008
Author: 	Crack
Homepage:	www.kit-coding.de
Email: 		Info@kit-coding.de


---------------------------------------------------------------------------------------------------
INSTAL HowTo 
---------------------------------------------------------------------------------------------------
1.  Lade alle ordner unter beibehaltung der Ordnerstruktur hoch. ( Es werden keine Dateien berschrieben!)
2.  Rufen Sie die Install.php auf ber: http://www.deinedomain.de/include.php?path=install
2.a Nach erfolgreichem installieren lschen Sie die install wieder von Ihrem Server!!!!
3.  Geben sie dem Ordner images/realpic CHMOD 777 Rechte. 
4.  ndere nun folgende Dateien

pkinc/public/userprofile.php
pkinc/public/userinfo.php
pkinc/admin/config.php
pkinc/admintpl/config_avatar.htm
pkinc/publictpl/userinfo.htm
pkinc/publictpl/extoption.htm
pkinc/publictpl/forum/showthread_row.htm
pkinc/public/forumsthread.php

=======================================================================
pkinc/public/userprofile.php

suche:

$modehash=array('avatar',

Fge dahinter an mit:

'realpic',

Die Zeile sollte dann so aussehen:

$modehash=array('avatar','realpic','delete','edit','friends','options');

Suche weiter:

eval("\$site_body.= \"".pkTpl("getavatar")."\";");
			}		
		break;
		#END case avatar


Fge darunter ein:

// Anfang RealPic frs Benutzerprofil 1.0 by Crack
	case 'realpic' :
		pkLoadFunc('user');
		$user_navigation=pkUserNavigation();


		$ACTION=(isset($_POST['action'])) ? $_POST['action'] : 'view';

		if(($_REQUEST['upload']==1 && $config['realpic_eod']==1) || ($config['realpic_eod']!=1 && $config['realpic_eod']!=2))
			{
			pkHeaderLocation('','','event=function_disabled');
			}


		if($ACTION==$_POST['cancel']) 
			{
			pkHeaderLocation('userprofile','realpic');
			}
	
		if(isset($_REQUEST['upload']))
			{
			if($ACTION==$_POST['upload_action'] && is_uploaded_file($_FILES['upload_pic']['tmp_name']))
				{
				move_uploaded_file($_FILES['upload_pic']['tmp_name'],pkDIRTEMP.strrchr($_FILES['upload_pic']['tmp_name'],'/'));
				$_FILES['upload_pic']['tmp_name']=pkDIRTEMP.strrchr($_FILES['upload_pic']['tmp_name'],'/');
				
				if($realpic_size=getimagesize($_FILES['upload_pic']['tmp_name']))
					{
					if($realpic_size[2]==1)
						$ext='.gif';
					elseif($realpic_size[2]==2)
						$ext='.jpg';
					elseif($realpic_size[2]==3)
						$ext='.png';
					else
						unset($ext);
					}					
				else
					{
					unset($realpic_size);
					}
				
				if(isset($ext) && isset($realpic_size))
					{
					$filesize=$_FILES['upload_pic']['size'];
					$filename='realuser_'.pkGetUservalue('id').$ext;
					
					if(($config['realpic_height']<$realpic_size[1]) || ($config['realpic_width']<$realpic_size[0]))
						$error=1;
					elseif($filesize<($config['realpic_size']*1024) && $filesize!=0)
						{
						$UPLOAD=new UPLOAD();
						$uploadreturned=$UPLOAD->images($_FILES['upload_pic'],$config['realpic_path'],$filename);
						
						if($uploadreturned[0]==TRUE)
							{
							unlink($_FILES['upload_pic']['tmp_name']);	 
							
							pkHeaderLocation('userprofile','options','setrealpic='.urlencode(basename($filename)));
							}
						else
							{
							$error=4;
							}
						}
					else
						{
						$error=2;
						}
					}
				else
					{
					$error=3;
					}
				
				pkHeaderLocation('userprofile','realpic','upload&error='.$error);
				}
			else
				{
				$error=(isset($_REQUEST['error']) && intval($_REQUEST['error'])>0 && intval($_REQUEST['error'])<5) ? intval($_REQUEST['error']) : 0;

				
				if($error==1)
					eval("\$realpic_message=\"".pkTpl("getrealpicavatar_upload_error1")."\";");
				elseif($error==2)
					eval("\$realpic_message= \"".pkTpl("getrealpicavatar_upload_error2")."\";");
				elseif($error==3)
					eval("\$realpic_message= \"".pkTpl("getrealpicavatar_upload_error3")."\";");
				else
					eval("\$realpic_message= \"".pkTpl("getrealpicavatar_upload_message")."\";");
				
				eval("\$site_body.= \"".pkTpl("getrealpicavatar_upload")."\";");
				} 
			}
		else
			{
			$dir2=$config['realpic_path'];
			$width=1;
			$row='odd';
			
			$a=opendir($dir2);
			while($datei2=readdir($a))
				{
				if(strstr($datei2,"realpic") || (pkGetUservalue('status')=='member' && strstr($datei2,"realpicmember")) || (pkGetUservalue('status')=='mod' && (strstr($datei2,"realpicmod") || strstr($datei2,"realpicmember"))) || (pkGetUservalue('status')=='admin' && (strstr($datei2,"realpicadmin") || strstr($datei2,"realpicmod") || strstr($datei2,"realpicmember")))) 
					{
					if($width==4)
						{
						eval("\$realpic_list.= \"".pkTpl("getrealpicavatar_rowbreak")."\";");
						$width=1;
						$row=rowcolor($row);
						}
					
					if(!$realpic_dimension=@getimagesize($dir2."/".$datei2))
						unset($realpic_dimension);
					
					eval("\$realpic_list.= \"".pkTpl("getrealpicavatar_list")."\";");
					$width++;
					}
				}
			closedir($a);
			
			$cs=4-$width;
			if($cs>0)
				eval("\$realpic_list.= \"".pkTpl("getrealpicavatar_lastrow")."\";");
				
			if($config['realpic_eod']==2)
				eval("\$realpic_uploadlink= \"".pkTpl("getrealpicavatar_uploadlink")."\";");
			
			eval("\$site_body.= \"".pkTpl("getrealpicavatar")."\";");
			}		
		break;
// Ende RealPic frs Benutzerprofil 1.0 by Crack


Suche weiter:

$SQL->query("UPDATE ".pkSQLTAB_USER." 
				SET user_avatar='".$SQL->f($avatar)."' 
				WHERE user_id='".$SQL->i(pkGetUservalue('id'))."'");

			pkHeaderLocation('userprofile','options');
			}

Fge darunter ein:

// Anfang RealPic frs Benutzerprofil 1.0 by Crack
			if(isset($_REQUEST['setrealpic']))
			{
			if($_REQUEST['unset']==1)
				{
				if(strstr($_REQUEST['setrealpic'],'realpicuser'))
					{
					$name=pkGetConfig('realpic_path')."/realpicuser_".pkGetUservalue('id').".";

					@unlink($name.'gif');
					@unlink($name.'jpg');
					@unlink($name.'png');
					}

				unset($_REQUEST['setrealpic']);
				}
	
			$avatar=basename($_REQUEST['setrealpic']);
			$path=pkGetConfig('realpic_path').'/'.$avatar;

			if(!pkFileCheck($path) || substr($path,-4)=='.php')
				$avatar='';	
	
			$SQL->query("UPDATE ".pkSQLTAB_USER." 
				SET user_realpic='".$SQL->f($avatar)."' 
				WHERE user_id='".$SQL->i(pkGetUservalue('id'))."'");

			pkHeaderLocation('userprofile','options');
			}
// Ende RealPic frs Benutzerprofil 1.0 by Crack

Suche weiter:

}
			
			eval("\$avatar_eod= \"".pkTpl("extoption_avatar")."\";");
			}

Fge darunter ein:

// Anfang RealPic frs Benutzerprofil 1.0 by Crack
			if($config['realpic_eod']==1 || $config['realpic_eod']==2)
			{
			$userinfo['user_realpic']=basename($userinfo['user_realpic']);
			
			if($userinfo['user_realpic']!='' && @filecheck($config['realpic_path']."/".$userinfo['user_realpic']))
				{
				$realpic_dimension[3]=@getimagesize($config['realpic_path']."/".$userinfo['user_realpic']);
		
				eval("\$realpic_show= \"".pkTpl("user_realavatar_show")."\";");
				eval("\$realpic_deselect= \"".pkTpl("extoption_realavatar_deselect")."\";");
				}
			
			if($config['realpic_eod']==2)
				{
				eval("\$realpic_upload= \"".pkTpl("extoption_realavatar_upload")."\";");
				}
			
			eval("\$realpic_eod= \"".pkTpl("extoption_realavatar")."\";");
			}
// Ende RealPic frs Benutzerprofil 1.0 by Crack


=======================================================================

pkinc/public/userinfo.php

Suche:

else
	{
	eval("\$avatar_eod= \"".pkTpl("userinfo_avatar_off")."\";");
	}

Fge darunter ein:

// Anfang RealPic frs Benutzerprofil 1.0 by Crack
if($config['realpic_eod']!=0)
	{
	$userinfo['user_realpic']=basename($userinfo['user_realpic']);
	
	if(!empty($userinfo['user_realpic']) && @filecheck($config['realpic_path']."/".$userinfo['user_realpic']))
		{
		$realpic_dimension[3]=@getimagesize("images/realpic/".$userinfo['user_realpic']);
		eval("\$realpic_show= \"".pkTpl("user_realavatar_show","")."\";");
		}
	else
		{
		$realpic_show='Kein Foto gew&auml;hlt';
		}
	
	eval("\$realpic_eod= \"".pkTpl("userinfo_realpic")."\";");
	}
else
	{
	eval("\$realpic_eod= \"".pkTpl("userinfo_realpic_off")."\";");
	}
// Ende RealPic frs Benutzerprofil 1.0 by Crack

=======================================================================

pkinc/admin/config.php

Suche:

unset($_POST['avatar_path']);

Fge darunter an:

// Anfang RealPic frs Benutzerprofil 1.0 by Crack
		$realpicpath=explode("/",$_POST['realpic_path']);
		unset($_POST['realpic_path']);
// Ende RealPic frs Benutzerprofil 1.0 by Crack

Suche weiter:

$_POST['avatar_path'].="/".$p;
					}
				}
			}

Fge darunter ein:

// Anfang RealPic frs Benutzerprofil 1.0 by Crack
		if(is_array($realpicpath)) 
			{
			foreach($realpicpath as $p)
				{
				$p=trim($p);
				if($p!="")
					{
					if($_POST['realpic_path']=="") 
						$_POST['realpic_path']=$p;
					else
						$_POST['realpic_path'].="/".$p;
					}
				}
			}
// Ende RealPic frs Benutzerprofil 1.0 by Crack

Suche weiter:

$SQL->query("UPDATE ".pkSQLTAB_CONFIG." SET
			avatar_size='".intval($_POST['avatar_size'])."',
			avatar_height='".intval($_POST['avatar_height'])."',
			avatar_width='".intval($_POST['avatar_width'])."',
			avatar_eod='".intval($_POST['avatar_eod'])."',
			avatar_path='".$SQL->f($_POST['avatar_path'])."'");

Ersetze mit:

$SQL->query("UPDATE ".pkSQLTAB_CONFIG." SET
			avatar_size='".intval($_POST['avatar_size'])."',
			avatar_height='".intval($_POST['avatar_height'])."',
			avatar_width='".intval($_POST['avatar_width'])."',
			avatar_eod='".intval($_POST['avatar_eod'])."',
			avatar_path='".$SQL->f($_POST['avatar_path'])."',
			realpic_size='".intval($_POST['realpic_size'])."',
			realpic_height='".intval($_POST['realpic_height'])."',
			realpic_width='".intval($_POST['realpic_width'])."',
			realpic_eod='".intval($_POST['realpic_eod'])."',
			realpic_path='".$SQL->f($_POST['realpic_path'])."'");

Suche weiter:

else
			{
			$info_avatar_eod0=" selected";
			}

Fge darunter ein:

// Anfang RealPic frs Benutzerprofil 1.0 by Crack
		if($config['realpic_eod']==1)
			{
			$info_realpic_eod1=" selected";
			}
		elseif($config['realpic_eod']==2)
			{
			$info_realpic_eod2=" selected";
			}
		else
			{
			$info_realpic_eod0=" selected";
			}
// Ende RealPic frs Benutzerprofil 1.0 by Crack

Suche weiter:

eval("\$path_error= \"".pkTpl("config_avatar_patherror")."\";");

Fge darunter ein:

// Anfang RealPic frs Benutzerprofil 1.0 by Crack
		if(!@is_writable('../'.$config['realpic_path']) || !@is_dir('../'.$config['realpic_path'])) 
			eval("\$path_error= \"".pkTpl("config_avatar_patherror")."\";");
// Ende RealPic frs Benutzerprofil 1.0 by Crack	

=======================================================================

pkinc/admintpl/config_avatar.htm

Suche:

<tr>
  <td class="left">Abmessungen<br />
	<font class="small">Maximale Gr&ouml;sse von Avataren in Pixeln. H&ouml;he x Breite</font></td>
  <td class="right">
	<table border="0" cellspacing="0" cellpadding="1">
 	 <tr>
	  <td><input type="text" name="avatar_height" value="$config[avatar_height]" maxlength="3" size="2" /></td>
	  <td>&nbsp;x&nbsp;</td>
	  <td><input type="text" name="avatar_width" value="$config[avatar_width]" maxlength="3" size="2" /></td>
	 </tr>
	</table>
  </td>
 </tr>

Fge darunter ein:

<!-- Anfang RealPic frs Benutzerprofil 1.0 by Crack -->
  <tr>
  <td class="heads" colspan="2">
	<table border="0" cellspacing="0" cellpadding="0" width="100%">
      <tr>
  	  <td><a name="realpic">&nbsp;</a></td>
	  <td width="100%"><font class="heads">Fotos</font></td>  
	  <td>$toplink</td>
      </tr>
	</table>
  </td>
 </tr>
 <tr>
  <td class="left" width="50%"> Verwendung von Fotos<br />
	<font class="small">Legt fest ob User Fotos benutzen k&ouml;nnen.</font></td>
  <td class="right" width="50%">
	<select name="realpic_eod" size="3" class="w90">
	<option value="2" $info_realpic_eod2>Hochladen &amp; Verwendung von Fotos erlaubt</option>
	<option value="1" $info_realpic_eod1>nur vorgegebenen Fotos</option>
	<option value="0" $info_realpic_eod0>keine Verwendung von Fotos</option>
	</select></td>
 </tr>
 <tr>
  <td class="left">Foto verzeichnis<br />
	<font class="small">Speicherort f&uuml;r alle Fotos. Dieses Verzeichnis muss vorhanden sein und Schreibrechte 
	besitzen. Angabe ausgehend vom Installationsverzeichnis.</font> $path_error</td>
  <td class="right">
	<input type="text" maxlength="250" size="25" name="realpic_path" value="$config[realpic_path]" class="w90" /></td>
 </tr>
 <tr>
  <td class="left">Dateigr&ouml;sse<br />
	<font class="small">Legt die maximale Gr&ouml;sse von User Fotos fest (Angabe in kB).</font></td>
  <td class="right">
	<input type="text" name="realpic_size" value="$config[realpic_size]" maxlength="5" size="5" />
 </tr>
 <tr>
  <td class="left">Abmessungen<br />
	<font class="small">Maximale Gr&ouml;sse von den Fotos in Pixeln. H&ouml;he x Breite</font></td>
  <td class="right">
	<table border="0" cellspacing="0" cellpadding="1">
 	 <tr>
	  <td><input type="text" name="realpic_height" value="$config[realpic_height]" maxlength="3" size="2" /></td>
	  <td>&nbsp;x&nbsp;</td>
	  <td><input type="text" name="realpic_width" value="$config[realpic_width]" maxlength="3" size="2" /></td>
	 </tr>
	</table>
  </td>
 </tr>
<!-- Ende RealPic frs Benutzerprofil 1.0 by Crack -->

=======================================================================

pkinc/publictpl/userinfo.htm

Suche:

<td width="25%" valign="top">$avatar_eod</td>

Ersetze mit:

<td width="25%" valign="top">$avatar_eod<br /> $realpic_eod</td>

=======================================================================

pkinc/publictpl/extoption.htm

Suche:

$avatar_eod

Fge darunter ein:

$realpic_eod

=======================================================================

pkinc/publictpl/forum/showthread_row.htm

Suche:

$avatar_show

Ersetze mit:

$avatar_show $realpic_show

=======================================================================

pkinc/public/forumsthread.php

Suche:

if($config['avatar_eod']!=0 && $userinfo['user_avatar']!="" && filecheck($config['avatar_path'].'/'.$userinfo['user_avatar']))
				{
				$avatar_dimension=@getimagesize($config['avatar_path']."/".$userinfo['user_avatar']);
						
				$realpic_show="";
				eval("\$avatar_show=\"".pkTpl("user_avatar_show")."\";");
				
				}

Ersetze mit:

if($config['realpic_eod']!=0 && $userinfo['user_realpic']!="" && filecheck($config['realpic_path'].'/'.$userinfo['user_realpic']))
				{
				$realpic_dimension=@getimagesize($config['realpic_path']."/".$userinfo['user_realpic']);
						
				eval("\$realpic_show=\"".pkTpl("user_realavatar_show")."\";");
				$avatar_show="";
				}
			elseif($config['avatar_eod']!=0 && $userinfo['user_avatar']!="" && filecheck($config['avatar_path'].'/'.$userinfo['user_avatar']))
				{
				$avatar_dimension=@getimagesize($config['avatar_path']."/".$userinfo['user_avatar']);
						
				$realpic_show="";
				eval("\$avatar_show=\"".pkTpl("user_avatar_show")."\";");
				
				}

Solltet Ihr den Standardavatar Hack installiert haben, sodass Bilder angezeigt werden fr User & Gste die kein Avatar 
ausgewhlt haben, so sucht weiter:

// Standardavatar Anfang //
			else
			{
			eval ("\$avatar_show=\"".pkTpl("user_noavatar_show")."\";");
			}
// Standardavatar Ende //

Ersetze mit:

// Standardavatar Anfang //
			else
			{
				$avatar_show="";
				$realpic_show="";
			eval ("\$avatar_show=\"".pkTpl("user_noavatar_show")."\";");
			}
// Standardavatar Ende //




Support:
============================

Support & Fragen: 

Support gebe ich gerne unter www.fighting-rebels.de


